<div class="content-box">
    <div id="friendList">

        <?php if (count($this->users) != 0) : ?>
            <table style="width: 100%">
                <thead>
                <th>Nombre</th>
                <th>Apellido</th>
                <th>e-mail</th>
                <th></th>
                </thead>                

                <?php foreach ($this->users as $friend): ?>

                    <tr>
                        <td><?php echo $friend->profile->name; ?></td>
                        <td><?php echo $friend->profile->surname; ?></td>
                        <td><?php echo $friend->email; ?></td>
                        
                        <?php if(Friendship::checkFriendStatus($friend->id) == 0): ?>
                            <td>Ya eres amigo!!</a></td>
                        <?php endif; ?>
                        
                        <?php if(Friendship::checkFriendStatus($friend->id) == 1): ?>
                            <td>Solicitud Enviada</a></td>
                        <?php endif; ?>
                        
                        <?php if(Friendship::checkFriendStatus($friend->id) == 2): ?>
                            <td><a class="addFriend" href="/friendship/acceptfriend/id/<?php echo $friend->id; ?>">Aceptar Solicitud</a></td>
                        <?php endif; ?>
                        
                        <?php if(Friendship::checkFriendStatus($friend->id) == 3): ?>
                            <td><a class="addFriend" href="/friendship/addfriend/id/<?php echo $friend->id; ?>">Agregar Amigo</a></td>
                        <?php endif; ?>
                            
                        
                    </tr>

                <?php endforeach; ?>
            </table>
        <?php else: ?>
            <h3>No hay Resultados</h3>
        <?php endif; ?>

    </div>

</div>

